﻿
@{
    ViewBag.Title = "DischargeSettlement";
    Layout = "~/Views/Shared/_Index.cshtml";
}
<div style="float:left;">
    <div class="rows" style="margin-bottom: 1%;" id="divPatHospitalizationSettBasicInfo">
        <div class="panel panel-default" style="margin-bottom:0;">
            <div class="panel-heading navb-bg">
                住院病人信息
            </div>
            <table class="form" style="width:100%;">

                <tr>
                    <td class="formTitle">卡号：</td>
                    <td class="formValue">
                        <input class="form-control " type="text" id="kh" value="" />
                    </td>
                    <td class="formTitle">住院号：</td>
                    <td class="formValue">
                        <input class="form-control " type="text" id="zyh" value="" />
                    </td>

                    <td class="formTitle">姓名：</td>
                    <td class="formValue">
                        <input class="form-control " type="text" id="xm" value="" />
                    </td>
                </tr>
                <tr id="mark">
                    <td colspan="10">
                        <div style="background-color:#fcfcfc;color:#00a0ea;height:15px; text-align:center"><label id="moreBtn" class="fa fa-angle-double-down"></label></div>
                    </td>
                </tr>
                <tr class="moreInfo">
                    <td class="formTitle">病历号：</td>
                    <td class="formValue">
                        <input class="form-control newtouch_Readonly" type="text" id="blh" value="" />
                    </td>
                    <td class="formTitle">性别：</td>
                    <td class="formValue">
                        <input class="form-control newtouch_Readonly" readonly="readonly" type="text" id="xb" value="" />
                    </td>
                    <td class="formTitle">患者类型：</td>
                    <td class="formValue">
                        <input class="form-control newtouch_Readonly" type="text" id="brxzmc" value="" />
                    </td>
                    <td class="formTitle">医保证号：</td>
                    <td class="formValue">
                        <input class="form-control newtouch_Readonly" type="text" value="" id="pzh" />
                    </td>

                    <td class="formTitle">入院日期：</td>
                    <td class="formValue">
                        <input class="form-control newtouch_Readonly" type="text" value="" id="ryrq" />
                    </td>
                </tr>
                <tr class="moreInfo">
                    <td class="formTitle">出院日期：</td>
                    <td class="formValue">
                        <input id="Kssj" type="text" class="form-control input-wdatepicker newtouch_Readonly" value="@DateTime.Now.ToString("yyyy-MM-dd")" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" />
                    </td>
                </tr>
                <tr id="markdis">
                    <td colspan="10">
                        <div style="background-color:#fcfcfc; color:#00a0ea; height:15px; text-align:center"><i id="disBtn" class="fa fa-angle-double-up" style="color:rgb(0, 160, 233);cursor:pointer; "></i></div>
                    </td>
                </tr>
            </table>
        </div>
    </div>
    <div style="margin-bottom: 1%;">
        <table id="gridList"></table>
    </div>
</div>



@Html.Partial("_BottomButtonsView", new Newtouch.HIS.Web.Core.Models.BottomButtonViewModel()
{
    ShowKeyList = new int[] { 4, 8 }
})
<style>
    /*span {
        color: red;
    }*/

    .active {
        background: rgb(238, 238, 238) !important;
    }
</style>
<script type="text/javascript">
    $(function () {
        gridListData([]);
        $(".moreInfo").hide();
        $("#markdis").hide();
        $("#moreBtn,#disBtn").click(function () {
            $(".moreInfo").toggle();//.show();
            $("#mark").toggle();//.hide();
            $("#markdis").toggle();

        });
    });
    //绑定grid
    function gridListData(mydata) {

        var captionCon = "项目信息";
        captionCon += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span id='yeCon'>总额： <span style=\"color:red;font-size:large;\"><strong>1000.00</strong></span>元";

        var $gridList = $("#gridList");
        $gridList.newtouchLocalDataGrid({
            height: $(window).height() - 290,
            unwritten: false,
            shrinkToFit: true,
            caption: captionCon,
            colModel: [
                { label: "主键", name: "patid", hidden: true },
                { label: '项目名称', name: 'ItemName', width: 300, align: 'left', editor: "text" },
                { label: '替代项目', name: 'ReplaceTtemName', width: 100, align: 'left', editor: "text" },
                { label: '单位', name: 'Unit', width: 100, align: 'left', editor: "text" },
                { label: '单价', name: 'UnitPrice', width: 100, align: 'left', editor: "text" },
                { label: '自付比例', name: 'zfbl', width: 100, align: 'left', editor: "text", },
                { label: '数量', name: 'ItemCount', width: 100, align: 'left', editor: "text" },
                { label: '金额', name: 'Total', width: 100, align: 'left', editor: "text" },
                { label: '备注', name: 'Remark', width: 100, align: 'left', editor: "text" }
            ]
        });

        var mydata = [{ sl: "1001", ItemName: "红外线治疗", Replacesl: "1001", ReplaceTtemName: "", ItemCount: "1", Unit: "部位", SingleTimeLength: "30", UnitPrice: "20", Total: "20", Remark: "" },
    { zfbl: "0", ItemName: "运动治疗", Replacesl: "2001", ReplaceTtemName: "激光疗法", ItemCount: "1", Unit: "部位", SingleTimeLength: "5", UnitPrice: "10", Total: "10", Remark: "激光治疗代替运动" },
    { zfbl: "0", ItemName: "运动治疗", Replacesl: "2002", ReplaceTtemName: "低频脉冲电治疗", ItemCount: "2", Unit: "部位", SingleTimeLength: "10", UnitPrice: "20", Total: "40", Remark: "低频脉冲电治疗代替运动" },
    { zfbl: "0", ItemName: "神经肌肉电刺激治疗", Replacesl: "", ReplaceTtemName: "", ItemCount: "1", Unit: "部位", SingleTimeLength: "5", UnitPrice: "10", Total: "10", Remark: "" },
    { zfbl: "0", ItemName: "中频脉冲电治疗", Replacesl: "", ReplaceTtemName: "", ItemCount: "1", Unit: "部位", SingleTimeLength: "20", UnitPrice: "30", Total: "30", Remark: "" },
    { zfbl: "0", ItemName: "立体动态干扰电治疗", Replacesl: "2003", ReplaceTtemName: "超短波（小功率）", ItemCount: "1", Unit: "部位", SingleTimeLength: "", UnitPrice: "8", Total: "8", Remark: "超短波（小功率）代替立体动态干扰电治疗" },
    { zfbl: "0", ItemName: "立体动态干扰电治疗", Replacesl: "2004", ReplaceTtemName: "超短波（大功率）", ItemCount: "1", Unit: "部位", SingleTimeLength: "", UnitPrice: "8", Total: "10", Remark: "超短波（大功率）代替立体动态干扰电治疗" },
    { zfbl: "0", ItemName: "立体动态干扰电治疗", Replacesl: "2005", ReplaceTtemName: "超短波（脉冲）", ItemCount: "1", Unit: "部位", SingleTimeLength: "", UnitPrice: "8", Total: "10", Remark: "超短波（脉冲）代替立体动态干扰电治疗" },
    { zfbl: "0", ItemName: "立体动态干扰电治疗", Replacesl: "2006", ReplaceTtemName: "超短波（小功率）（≥3照射区）", ItemCount: "1", Unit: "", SingleTimeLength: "", UnitPrice: "24", Total: "10", Remark: "超短波（小功率）（≥3照射区）代替立体动态干扰电治疗" },
    { zfbl: "0", ItemName: "立体动态干扰电治疗", Replacesl: "2007", ReplaceTtemName: "超短波（大功率）（≥3照射区）", ItemCount: "1", Unit: "", SingleTimeLength: "", UnitPrice: "24", Total: "10", Remark: "超短波（大功率）（≥3照射区）代替立体动态干扰电治疗" },
    { zfbl: "0", ItemName: "微波治疗", Replacesl: "2008", ReplaceTtemName: "微波治疗（≥3照射区）", ItemCount: "1", Unit: "部位", SingleTimeLength: "5", UnitPrice: "10", Total: "10", Remark: "激光治疗代替微波治疗" },
    { zfbl: "0", ItemName: "微波治疗", Replacesl: "2009", ReplaceTtemName: "单纯超声波", ItemCount: "1", Unit: "部位", SingleTimeLength: "5", UnitPrice: "10", Total: "10", Remark: "微波治疗（≥3照射区）代替微波治疗" },
    { zfbl: "0", ItemName: "牵引（颈牵引）", Replacesl: "", ReplaceTtemName: "", ItemCount: "1", Unit: "部位", SingleTimeLength: "5", UnitPrice: "10", Total: "10", Remark: "" }];
        for (var i = 0; i <= mydata.length; i++) {
            $gridList.jqGrid('addRowData', i + 1, mydata[i]);
        }
    }

    window.newtouch_globalconfig.f4opions = {
        container: "#divPatHospitalizationSettBasicInfo, #divPatHospitalizationSettFeeInfo"
    };

    //清除操作
    var funcDoPageClear = function () {
        newtouch_globalevent_f4();
    };

    //结算
    function newtouch_event_f8() {
        var zyh = $.trim($('#zyh').val());
        var jsje = $.trim($('#txtSettJSJE').val());
        var cyrq = $.trim($('#cyrq').val());
        var url = "/HospitalizationManage/Settlement/SettPreview?zyh=" + zyh + "&expectedjsje=" + jsje + "&expectedcyrq=" + cyrq + "&r=" + Math.random();
        if (zyh && jsje) {
            $.modalOpen({
                id: "FormShowSett",
                title: "结算",
                url: url,
                width: "670px",
                height: "490px",
                callBack: function (iframeId) {
                    top.frames[iframeId].submitSett();
                }
            });
        }
    }

    function showSettSuccessDialog(yingshoukuan, ssk, srce, zhaoling) {
        var url = "/HospitalizationManage/Settlement/SettSuccessDialog?yingshoukuan=" + yingshoukuan
            + "&ssk=" + ssk
            + "&srce=" + srce
            + "&zhaoling=" + zhaoling;
        $.modalOpen({
            id: "FormShowSettSuccessDialog",
            title: "结算成功",
            url: url,
            width: "320px",
            height: "240px",
            //btn: ['关闭'],
            //btnclass: ['btn btn-danger'],
            btn: null,
            callBack: function (iframeId) {
                //top.top.window.frames['FormShowSettSuccessDialog'].$.modalClose();
            }
        });
    }

</script>
